package com.lucian.ge.user.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * Created by Lucicol on 2019/5/14.
 */
@ApiModel
public class User {
    @ApiModelProperty(value = "手机号")
    @NotEmpty(message="手机号不能为空")
    @Pattern(regexp = "1[3|4|5|7|8][0-9]\\d{8}",message="手机号格式错误")
    private String username;
    @ApiModelProperty(value = "密码")
    @NotEmpty(message="密码不能为空")
    @Length(max = 15, min = 8,message = "密码长度限制8~15字符")
//    @Pattern(regexp = "^[0-9]{6,16}$|^[a-zA-Z]{6,16}$",message="密码为数字或字母")
    private String password;
    @Length(max = 30, min = 2,message = "昵称长度限制2~30字符")
    private String nikname;
    @Length(max = 30, min = 2,message = "角色长度限制2~30字符")
    private String role;
    @Length(max = 30, min = 2,message = "权限长度限制2~30字符")
    private String permission;
    @Length(max = 10, min = 1,message = "账户状态长度限制1~10字符")
    private String ban;
    private String gmt_create;
    private String gmt_modified;
    @ApiModelProperty(value = "短信验证码")
//    @NotEmpty(message="短信验证码不能为空")
    private String smscode;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getSmscode() {
        return smscode;
    }

    public void setSmscode(String smscode) {
        this.smscode = smscode;
    }
}
